package threads.string;

public class TurnBigStringUsing2Threads {

	public static void main(String[] args) {
		
	String longString = getLongString();	
	
	long start = System.currentTimeMillis();
	String turnedLongString01 = turnStringUsingOneThread(longString);
	long end = System.currentTimeMillis();
	System.out.println("One thread works " + (end -start) + " ms. Result : " + turnedLongString01);
	
	
	}

	private static String turnStringUsingOneThread(String longString) {
		
		StringBuilder sb = new StringBuilder(); 
		
		for (int i = 0; i < longString.length(); i++) {
			sb.append(longString.valueOf(longString.length()-i-1));
		}
		return sb.toString();
	}

	private static String turnStringUsingTwoThread(String longString) {
    
    
    return null;
    }
	
	
	private static String getLongString() {
		return "01234trrrrbvkutkbekreubtkbtbetyueryteurktykuerytukerytukeryuktyukerytukr" +
"retertertertertertertertretretdfgdfgdfgdfdfdddddddddddddddddddddddddddddddddddgfdgfdgfdgfgf" +
"retertertertertertertertretretdfgdfgdfgdfdfdddddddddddddddddddddddddddddddddddgfdgfdgfdgfgf" +
"retertertertertertertertretretdfgdfgdfgdfdfdddddddddddddddddddddddddddddddddddgfdgfdgfdgfgf" +
"retertertertertertertertretretdfgdfgdfgdfdfdddddddddddddddddddddddddddddddddddgfdgfdgfdgfgf" +
"retertertertertertertertretretdfgdfgdfgdfdfdddddddddddddddddddddddddddddddddddgfdgfdgfdgfgf" +
"retertertertertertertertretretdfgdfgdfgdfdfdddddddddddddddddddddddddddddddddddgfdgfdgfdgfgf" +
"retertertertertertertertretretdfgdfgdfgdfdfdddddddddddddddddddddddddddddddddddgfdgfdgfdgfgf" +
"retertertertertertertertretretdfgdfgdfgdfdfdddddddddddddddddddddddddddddddddddgfdgfdgfdgfgf" +
"retertertretretrtrtretretertreter56789";
	}
	
}
